#pragma once

template <typename Item>
class EIterator
{
public:
	EIterator(void);
	EIterator(EIterator<Item> &);
	virtual void operator++() = 0;
	virtual void operator++(int i = 0) = 0;
	virtual Item& operator*() = 0;
	virtual Item* operator->() = 0;
	virtual bool IsDone() = 0;
	virtual ~EIterator(void);
private:
	int _position;
};

template <typename Item>
class EIteratorProxy
{
public:
	EIteratorProxy(EIterator<Item> *instance)
	{
		_instance = instance;
	}
	~EIteratorProxy()
	{
		if(_instance != NULL)
			delete _instance;
	}
	void operator++(){_instance->operator++();}
	void operator++(int i = 0){_instance->operator++(0);}
	Item& operator*() {return *_instance();}
	Item* operator->() {return _instance->();}
	bool IsDone(){ return _instance->IsDone();}
	EIterator<Item>* GetEIterator(){ return _instance;}

private:
	EIteratorProxy(EIteratorProxy<Item> &proxy){}
	void operator=(EIteratorProxy<Item> &proxy){}
private:
	EIterator<Item> *_instance;
};
